package com.asiainfo.work.utils;

import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

/**
 * 请求查询基类
 * @author: bf
 * @date: 2021/1/5-10:20
 */
@AllArgsConstructor
@NoArgsConstructor
@Getter
@Setter
public class BaseRequest implements Serializable {

    private static final long serialVersionUID = -5564061087294872106L;

    private static final int PAGE_SIZE = 100;

    @ApiModelProperty(value = "每页显示条数，默认100", example = "100")
    private Integer size = PAGE_SIZE;


    @ApiModelProperty(value = "当前页，默认1", example = "1")
    private Integer page = 1;

    public void setPage(Integer page) {
        this.page = page;
    }

    public Integer getPage() {
        return this.page;
    }

    public void setSize(Integer size) {
        if (size == null && size == 0) {
            this.size = PAGE_SIZE;
        }
        this.size = size;
    }
}
